@model Easy.Modules.User.Models.UserEntity
@{
    ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
    Layout = Layouts.NormalDefault;
    Style.Reqiured("Customer").AtHead();
    Script.Reqiured("validate").AtFoot();
    var returnUrl = ViewBag.ReturnUrl ?? ViewContext.HttpContext.Request.Query["ReturnUrl"];
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <input type="hidden" name="ReturnUrl" value="@returnUrl" />
    <input type="hidden" name="PhotoUrl" value="~/images/User-Avatar.png" />
    <div class="login-panel sign-up">
        <div class="login-panel-heading">
            <p>
                <a href="~/" target="_blank">
                    <img class="logo" src="@(this.WorkContext().SiteInformation.Logo_Mini)" alt="@(this.WorkContext().SiteInformation.SiteName)" />
                </a>
            </p>
        </div>
        <div class="login-panel-body">
            <div class="info-bar">
                <p>
                    @L("Please enter your user information to regist")
                </p>
                <img src="~/css/Images/picker_account_msa.svg" />
            </div>
            <div class="form-input">
                <h4>@L("Username")</h4>
                <input type="text"
                       placeholder="@L("Please enter your name")"
                       id="UserName"
                       name="UserName"
                       class="form-control"
                       data-val="true"
                       data-val-required="@L("{0} is required").Text.FormatWith(L("Username"))"
                       data-val-length="@L("{0} length should be less than {1}").Text.FormatWith(L("Username"),50)"
                       data-val-length-max="50"
                       value="@Model.UserName" />
                @Html.ValidationMessageFor(m => m.UserName)
            </div>
            <div class="form-input">
                <h4>@L("Email")</h4>
                <input type="email"
                       placeholder="@L("Your email address")"
                       id="Email"
                       name="Email"
                       class="form-control"
                       data-val="true"
                       data-val-required="@L("{0} is required").Text.FormatWith(L("Email"))"
                       data-val-length="@L("{0} length should be less than {1}").Text.FormatWith(L("Username"),200)"
                       data-val-length-max="200"
                       data-val-regex-pattern="@(Easy.Constant.RegularExpression.Email)"
                       data-val-regex="@L("Email is incorrect")"
                       value="@Model.Email" />
                @Html.ValidationMessageFor(m => m.Email)
            </div>
            <div class="form-input">
                <h4>@L("Password")</h4>
                <input type="password"
                       placeholder="@L("Enter your password")"
                       id="PassWord"
                       name="PassWord"
                       class="form-control"
                       data-val="true"
                       data-val-required="@L("{0} is required").Text.FormatWith(L("Password"))"
                       data-val-length="@L("{0} length should be less than {1}").Text.FormatWith(L("Password"),20)"
                       data-val-length-max="20" />
                @Html.ValidationMessageFor(m => m.PassWord)
            </div>
            <div class="form-input">
                <h4>@L("Confirm Password")</h4>
                <input type="password"
                       placeholder="@L("Enter your password")"
                       id="PassWordConfirm"
                       name="PassWordConfirm"
                       class="form-control"
                       data-val="true"
                       data-val-required="@L("{0} is required").Text.FormatWith(L("Password"))"
                       data-val-equalto="@L("Passwords are inconsistent")"
                       data-val-equalto-other="PassWord"
                       data-val-length="@L("{0} length should be less than {1}").Text.FormatWith(L("Password"),20)"
                       data-val-length-max="20" />
                <span class="field-validation-valid" data-valmsg-for="PassWordConfirm" data-valmsg-replace="true"></span>
            </div>
            @if (ViewBag.Errormessage != null)
            {
                <div class="text-center alert alert-danger">
                    @ViewBag.Errormessage
                </div>
            }
            <div class="form-input">
                <input type="submit" class="btn-login" value="@L("Sign up")" />
            </div>
        </div>
        <div class="login-panel-footer ">
            @L("Have account?") <a href="@Url.Action("SignIn", new { ReturnUrl = returnUrl })">@L("Sign in")</a>
        </div>
    </div>
}